<?php
// dsm($viewdata);
$this->load->library('table');

$table_heading = array(
	'Date',
	'Amount',
	'Description',
	'Biller',
);
$this->table->set_heading($table_heading);
$tmpl = array ( 'table_open'  => '<table border="1" cellpadding="2" cellspacing="1" class="table table-bordered table-stripped">' );
$this->table->set_template($tmpl);

print $this->table->generate($viewdata);

// Adding the pagination
$this->load->library('pagination');
$config['base_url'] = base_url() . 'bills/view';
$config['total_rows'] = $datacount;
$config['per_page'] = 10;
$config['num_links'] = 10;

// Pagination tag container
$config['full_tag_open'] = '<div class="pagination"><ul>';
$config['full_tag_close'] = '</ul></div>';

// Adding li to the numbers in pagination
$config['num_tag_open'] = '<li>';
$config['num_tag_close'] = '</li>';

// Adding li and a tag to the current page tag.
$config['cur_tag_open'] = '<li class="active"><a href="#">';
$config['cur_tag_close'] = '</a></li>';

// Handling the first link and last link
$config['first_tag_open'] = '<li>';
$config['first_tag_close'] = '</li>';
$config['last_tag_open'] = '<li>';
$config['last_tag_close'] = '</li>';

// Handling the next and prev link.
$config['next_link'] = '»';
$config['next_tag_open'] = '<li>';
$config['next_tag_close'] = '</li>';
$config['prev_link'] = '«';
$config['prev_tag_open'] = '<li>';
$config['prev_tag_close'] = '</li>';

$this->pagination->initialize($config);
print $this->pagination->create_links();
?>